import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
  base: '/docs/',
  lang: 'en-US',
  title: 'Template Doc',
  description: 'A VitePress Site',
  cleanUrls: true, // 末尾无 .html\
  
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    logo: '/assets/logo.svg',
    nav: [
      { text: 'Init Frame', link: '/init-frame/index' },
      { text: 'Develop', link: '/develop/base' },
      { text: 'TODO', link: '/memo/issues' },
  
      {
        text: '参考',
        items: [
          { text: 'VitePress', link: 'https://vitepress.dev/' },
        ],
      },
    ],

    // 此写法只有当url中包含如 init-frame 字段时，侧边栏才显示对应条目
    sidebar: {
      '/init-frame/': [
        {
          text: 'Init Frame',
          collapsed: false,
          items: [
            { text: 'frame', link: '/init-frame/index' },
            { text: 'vue3', link: '/init-frame/vue3' },
            { text: 'vue2', link: '/init-frame/vue2' },
            { text: 'vitepress', link: '/init-frame/vitepress' },
            { text: 'uniapp', link: '/init-frame/uniapp' },
          ],
        },
      ],
      '/develop/': [
        {
          text: 'Develop',
          collapsed: false,
          items: [
            { text: '基础', link: '/develop/base' },
            { text: '依赖', link: '/develop/dependency' },
            { text: '微信小程序', link: '/develop/mini' },
          ],
        },
      ],
      '/memo/': [
        { 
          text: 'TODO', 
          collapsed: false,
          items: [
            { text: '待办', link: '/memo/todo' },
            { text: '问题', link: '/memo/issues' },
          ],
        },
      ],
    },

    aside: true,
    // 解析深度嵌套标题
    outline: 'deep',

    footer: {
      message: 'Released under the MIT License.',
      copyright: 'Copyright © 2019-present Unicloud',
    },

    socialLinks: [
      { icon: 'github', link: 'https://gitee.com/yangggjian/vue-template/tree/dev/' },
    ],
    // localhost 也会从 aloglia 后台获取搜索数据
    algolia: {
      appId: 'DZNHWI5C39',
      apiKey: 'ef57c70b8b3dbbfb11d0f7013b100735',
      indexName: 'template-yamuu',
    },
  },
})
